package com.car.commons.web.util;

import cn.hutool.crypto.digest.MD5;

import java.nio.charset.StandardCharsets;

public class MD5util {
    public static String md5(String text,String salt)throws Exception{
        //加盐的位置
        int index = 4;
        //摘要次数
        int count = 5;
        MD5 md5 = new MD5(salt.getBytes(StandardCharsets.UTF_8), index, count);
        //返回16进制格式
        return md5.digestHex(text);
    }

    public static void main(String[] args) throws Exception {
        String phone = "18523976851";
        String pass = "123456";
        System.out.println(md5(phone, pass));

    }

}
